#include<iostream>

using namespace std;

const int N =1e6+10;
int arr[N];
int n;

void prin()
{
	for(int i=1;i<=n;i++)
	{
		cout<<arr[i]<<" ";
	}
	cout<<endl;
}

void push_a(int x)
{
	arr[++n]=x;
 } 
 
 void push(int x)
 {
 	for(int i=n;i>=1;i--)
 	{
 		arr[i+1]=arr[i];
	 }
	 arr[1]=x;
	 n++;
 }
void push_in(int x,int y)
{
	for(int i=n;i>=x;i--)
	{
		arr[i+1]=arr[i];
	}
	arr[x]=y;
	n++;
}

int main()
{
	push_a(2);
	prin();
	push_a(1);
	prin();
	push_a(3);
	prin();
	push_a(5);
	prin();
	push(10);
	prin();
	push_in(3,20);
	prin();
	
	return 0;
}
